import { ElMessage } from 'element-plus';

type ColumnValue = string | number | boolean;

export const deleteByKeyValue = async (
  url: string,
  columnName: string,
  columnValue: ColumnValue,
) => {
  const res = await api({
    method: 'delete',
    url: `${url}/deleteByKeyValue/${columnName}/${columnValue}`,
  });
  if (res.status === 200 && res.data.status) {
    ElMessage.success('删除成功');
    return res.data.body;
  } else {
    ElMessage.error(res.statusText);
  }
};
export const getListByConditions = async (url: string, data: any) => {
  const res = await api({
    method: 'post',
    url: '/system/user/getListByConditions',
  });
  console.log(res);

  return res;
};
